import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';

import { AppRoutingModule } from './app-routing.module';
import { AppComponent } from './app.component';
import { NZ_I18N } from 'ng-zorro-antd/i18n';
import { zh_CN } from 'ng-zorro-antd/i18n';
import { registerLocaleData } from '@angular/common';
import zh from '@angular/common/locales/zh';
import {FormsModule, ReactiveFormsModule} from '@angular/forms';
import {HTTP_INTERCEPTORS, HttpClientModule} from '@angular/common/http';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
import { IconsProviderModule } from './icons-provider.module';
import { NzLayoutModule } from 'ng-zorro-antd/layout';
import { NzMenuModule } from 'ng-zorro-antd/menu';
import {NzTableModule} from "ng-zorro-antd/table";
import {NzCardModule} from "ng-zorro-antd/card";
import {NzModalModule} from "ng-zorro-antd/modal";
import {NzButtonModule} from "ng-zorro-antd/button";
import {AlertService} from "./services/alert.service";
import {NzMessageModule} from "ng-zorro-antd/message";
import {IonicStorageModule} from "@ionic/storage-angular";
import { LoginComponent } from './components/login/login.component';
import { P401Component } from './components/p401/p401.component';
import { P403Component } from './components/p403/p403.component';
import {MyHttpInterceptor} from "./services/MyHttpInterceptor";
import { Drivers, Storage } from '@ionic/storage';
import {NzFormModule} from "ng-zorro-antd/form";
import { WelcomeComponent } from './components/welcome/welcome.component';
import {NzInputModule} from "ng-zorro-antd/input";

registerLocaleData(zh);

@NgModule({
  declarations: [
    AppComponent,
    LoginComponent,
    P401Component,
    P403Component,
    WelcomeComponent,

  ],
  imports: [
    BrowserModule,
    AppRoutingModule,
    FormsModule,
    HttpClientModule,
    BrowserAnimationsModule,
    IconsProviderModule,
    NzLayoutModule,
    NzMenuModule,
    NzTableModule,
    NzCardModule,
    NzModalModule,
    NzButtonModule,
    NzMessageModule,
    ReactiveFormsModule,
    NzFormModule,
    NzInputModule,
    IonicStorageModule.forRoot({
      name: 'sigmaclient',
      driverOrder: [ Drivers.LocalStorage]
    }),

  ],
  providers: [{ provide: NZ_I18N, useValue: zh_CN ,
  },
    {
      provide: HTTP_INTERCEPTORS,
      useClass: MyHttpInterceptor,
      multi: true
    }
  ],
  bootstrap: [AppComponent]
})
export class AppModule { }
